﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Day.aspx.cs" Inherits="JsonServer.Day" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body style="height: 1498px; width: 302px">
    <form id="form1" runat="server" 
    style="width: 297px; background-color: #00FF00; height: 1600px;">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanelOfMonthPage" runat="server">
        <ContentTemplate>
            
            <asp:ObjectDataSource ID="DataSourceFromTable" runat="server" 
                DeleteMethod="Delete" InsertMethod="Insert" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByDay" 
                TypeName="JsonServer.FYPDataSetTableAdapters.FYPPowerTableTableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_Id" Type="Int32" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="Power" Type="String" />
                    <asp:Parameter Name="CreateDate" Type="String" />
                </InsertParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="TextBoxOfDayPageYear" Name="YEAR" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TextBoxOfDayPageMonth" Name="MONTH" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TextBoxOfDayPageDay" Name="DAY" 
                        PropertyName="Text" Type="String" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Power" Type="String" />
                    <asp:Parameter Name="CreateDate" Type="String" />
                    <asp:Parameter Name="Original_Id" Type="Int32" />
                </UpdateParameters>
            </asp:ObjectDataSource>
            
            &nbsp;&nbsp;&nbsp;&nbsp; Year:<br /> &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="TextBoxOfDayPageYear" runat="server" style="text-align: left" 
                Width="245px" MaxLength="4"></asp:TextBox>
            <br />
            <asp:RegularExpressionValidator ID="RegularExpressionValidatorForYear" 
                runat="server" ControlToValidate="TextBoxOfDayPageYear" 
                ErrorMessage="Invalid Year value" ValidationExpression="\d{4}$">*</asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="RequiredFieldValidatorForYear" runat="server" 
                ControlToValidate="TextBoxOfDayPageYear" ErrorMessage="Please input year value" 
                ForeColor="Black">*</asp:RequiredFieldValidator>
            <br />
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp; Month:<br /> &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="TextBoxOfDayPageMonth" runat="server" Width="246px" 
                MaxLength="2"></asp:TextBox>
            <br />
            <asp:RegularExpressionValidator ID="RegularExpressionValidatorForMonth" 
                runat="server" ControlToValidate="TextBoxOfDayPageMonth" 
                ErrorMessage="Invalid Month value" ValidationExpression="\d{2}$">*</asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="RequiredFieldValidatorForMonth" runat="server" 
                ControlToValidate="TextBoxOfDayPageMonth" 
                ErrorMessage="Please input month value" ForeColor="Black">*</asp:RequiredFieldValidator>
            <br />
            &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp; &nbsp;day:<br /> &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="TextBoxOfDayPageDay" runat="server" Width="245px" 
                MaxLength="2"></asp:TextBox>
            <br />
            <asp:Button ID="ButtonCalculateDayPower" runat="server" Text="Calculate" 
                onclick="ButtonCalculateDayPower_Click" 
                
                
                style="z-index: 1; left: 25px; top: 311px; position: absolute; height: 50px; width: 251px" />
            <asp:RegularExpressionValidator ID="RegularExpressionValidatorForDay" 
                runat="server" ControlToValidate="TextBoxOfDayPageDay" 
                ErrorMessage="Invalid Day value" ValidationExpression="\d{2}$">*</asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="RequiredFieldValidatorForDay" runat="server" 
                ControlToValidate="TextBoxOfDayPageDay" ErrorMessage="Please input day value" 
                ForeColor="Black">*</asp:RequiredFieldValidator>
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <br />
            <br />
            <br />
            <asp:Label ID="LabelDayPower" runat="server" 
                
                
                
                
                
                style="z-index: 1; left: 23px; top: 449px; position: absolute; height: 20px;"></asp:Label>
            <br />
            <br />
            <asp:Chart ID="DayChart" runat="server" DataSourceID="DataSourceFromTable" 
                
                style="text-align: center; z-index: 1; left: 20px; top: 492px; position: absolute;" 
                Width="276px">
                <Series>
                    <asp:Series Name="Series1" ChartType="Spline" XValueMember="CreateDate" 
                        YValueMembers="Power" ChartArea="ChartArea1">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1">
                    </asp:ChartArea>
                </ChartAreas>
            </asp:Chart>
            <asp:ValidationSummary ID="ValidationSummary" runat="server" ForeColor="Red" 
                style="z-index: 1; left: 11px; top: 380px; position: absolute; height: 32px; width: 297px" />
            <br />
            <br />
            <br />
            <asp:GridView ID="DayOfPowerGridView" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="DataSourceFromTable"
                PageSize="30" CellPadding="4" ForeColor="#333333" GridLines="None" 
                Width="250px" 
                
                
                
                
                style="z-index: 1; left: 31px; top: 821px; position: absolute; height: 774px; width: 250px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Id" 
                        SortExpression="Id" ReadOnly="True" />
                    <asp:BoundField DataField="Power" HeaderText="Power"
                        SortExpression="Power" />
                    <asp:BoundField DataField="CreateDate" HeaderText="CreateDate" 
                        SortExpression="CreateDate" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div>
    </div>
    </form>
</body>
</html>
